import fetch from 'src/fetch'
import * as activityUrl from '../constant/activity'

// 活动详情
export const list = (params) => {
  return fetch({
    url: activityUrl.list,
    params
  })
}

// 根据id查询数据详情
export const get = (id) => {
  return fetch({
    url: activityUrl.detail+id,
    method: 'get'
  })
}

// 根据id删除数据
export const del = (activityId) => {
  return fetch({
    url: activityUrl.del+"/"+activityId,
    method: 'delete'
  })
}
// 修改数据 设置活动
export const set = (data) => {
  return fetch({
    url: activityUrl.set,
    method: 'post',
    data
  })
}
// 更改状态
export const updateStatus = (activityId, isEnable) => {
  return fetch({
    url: activityUrl.updateStatus+"/"+activityId+"/"+isEnable,
    method: 'put'
  })
}
